<?php
namespace app\index\validate;
use think\Validate;
class Users extends Validate
{
    // 验证规则
    protected $rule = [
		['user_mobile', 'mobile', '手机号格式错误'],
        ['user_password', 'require|min:6', '密码|密码不能短于6个字符'],
        ['email', 'email', '邮箱格式错误'],
        //['birthday', 'dateFormat:Y-m-d', '生日格式错误'],
    ];
    
	// 验证手机号格式
    protected function checkEmail($value, $rule)
    {
        $result = strstr($value,$rule);
        if($result)
            return true;
        else
            return "手机号格式错误";
    } 
	
    // 验证邮箱格式
    protected function checkMobile($value, $rule)
    {
        $result = strstr($value,$rule);
        if($result)
            return true;
        else
            return "邮箱格式错误";
    }

	
}